<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<title>访客申请-云校通</title>
<jsp:include page="/WEB-INF/page/common/_header.jsp"></jsp:include>
</head>
<body ontouchstart>
<div class="weui_tab tab-bottom">
	<div class="weui_tab_bd">
		<div class="weui-header bg-blue"> 
			<div class="weui-header-left"> <a onclick="back()" class="icon icon-109 f-white">返回</a></div>
			<h1 class="weui-header-title">访客详情</h1>
		</div>
        <div class="weui_cells mt0">
	        <div style="text-align: center;">
				<div id="qrcode" style="width:60%;left:20%;position: relative;">
				</div>
				<p class="mb10">刷二维码进校园</p>
			</div>
		</div>
		<div class="weui_cells weui_cells_form mt0">
			<div class="weui_cells_title">来访时间和事由</div>
			<div class="weui_cell">
				<div class="weui_cell_hd">
					<label class="weui_label">申请人</label>
				</div>
				<div class="weui_cell_bd weui_cell_primary">
					<p>${detail.studentName }的${detail.relation }</p>
				</div>
			</div>
			<div class="weui_cell">
				<div class="weui_cell_hd">
					<label class="weui_label">来访时间</label>
				</div>
                <div class="weui_cell_bd weui_cell_primary">
               		<fmt:formatDate value="${detail.visitStartTime}" pattern="yyyy-MM-dd hh:mm" />
           		</div>
            </div>
			<div class="weui_cell">
				<div class="weui_cell_hd">
					<label class="weui_label">离开时间</label>
				</div>
                <div class="weui_cell_bd weui_cell_primary">
                    <fmt:formatDate value="${detail.visitEndTime}" pattern="yyyy-MM-dd hh:mm" />
                </div>
            </div>
            <div class="weui_cell xtbg-add-list-title">
				<div class="weui_cell_bd weui_cell_primary">
					<p class="f14">来访事由</p>
				</div>
			</div>
            <div class="weui_cell">
                <div class="weui_cell_bd weui_cell_primary">
                    ${detail.visitPurpose}
                </div>
            </div>
         </div>
         <div class="weui_cells weui_cells_form mt10">
         	<div class="weui_cells_title">访客信息</div>
            <div class="weui_cell">
				<div class="weui_cell_hd">
					<label class="weui_label">访客姓名</label>
				</div>
                <div class="weui_cell_bd weui_cell_primary">
               		${detail.visitorName}
           		</div>
            </div>
            <div class="weui_cell">
				<div class="weui_cell_hd">
					<label class="weui_label">访客电话</label>
				</div>
                <div class="weui_cell_bd weui_cell_primary">
               		<a href="tel:${detail.phoneNo }">${detail.phoneNo}</a>
           		</div>
            </div>
            <div class="weui_cell">
				<div class="weui_cell_hd">
					<label class="weui_label">访客性别</label>
				</div>
                <div class="weui_cell_bd weui_cell_primary">
               		${detail.gender == 1 ? '男' : '女'}
           		</div>
            </div>
        </div>
	</div>
</div>
<script src="<%=basePath %>/js/qrcode.js" type="text/javascript"></script>
<script type="text/javascript">
$('#qrcode').qrcode({
    render: "table",
    size: 220,
    top: 20,
    text: "${detail.qrCode}"
});
</script>
</body>
</html>